<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="General-style.css">
	<script src="jquery.min.js"></script>
	<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
	<title>陕西服装工程学院-电脑维修预约</title>
</head>
<body>
	<div class="wrap">
		<div class="top">
			<div class="top_one">
				<div class="content">
					<ul>
						<li><a href="Home-page.html">退出</a></li>
						<li><a id="signName" href="modify.html">未登录</a></li>
					</ul>
				</div>
			</div>
			<div class="content top_two"><img src="images/logo.png"></div>
		</div>
		<div class="middle mid">
			<p>陕西服装工程学院-校园电脑维修预约</p>
			<div class="content user-interface">
				<ul id="software-hardware" class="clear">
					<li class="backgroundColor">已知故障</li>
					<li>未知故障</li>
				</ul>
				<div class="ware clear">
					<span>故障内容：</span><br><textarea placeholder="请简略描述故障，我们将及时派遣维修人员前往修复，维修费用将由维修工人跟您具体协商！（如果您未填写信息，我们将视作未知故障处理）"></textarea><br>
					<a class="sign-in">确认预约</a>
					<a href="Home-page.html" id="sign-in1">返回登录</a>
				</div>
				<div class="ware1 clear unshow">
					<span>因故障未知，我们将及时派遣维修人员前往检测修复，维修费用将由维修工人跟您具体协商！</span><br>
					<a class="sign-in">确认预约</a>
					<a href="Home-page.html" id="sign-in1">返回登录</a>
				</div>
				<strong id="strong">点击可直接查询到自己的订单</strong>
				<button id="button">订单查询</button>
			</div>
		</div>
		<div class="foot">
			<div class="content clear">
				<ul>
					<li><img src="images/weixin.jpg"><p>学院官方微信</p></li>
					<li><img src="images/sina.jpg"><p>招就办官方微信</p></li>
				</ul>
				<ol>
					<li><p>陕西服装工程学院</p></li>
					<li>校址：西安市西咸新区沣西新城崇文路1号</li>
					<li>招生：029-38114101 38114102 </li>
					<li>传真：029-38114112</li>
					<li>邮编：712046</li>
				</ol>
			</div>
		</div>
	</div>
	<script>
		$.ajax({
			url:`http://127.0.0.1:81/sign-success`,
			success:function(data){
				$("#signName").html(JSON.parse(data));
				$("#signName")[0].style.backgroundColor = "#f1f1f1";
				$("#signName")[0].style.color = "#333";
			},
		})
		$("#software-hardware li").click(function(){
			$("#software-hardware li").removeClass("backgroundColor");
			this.className = "backgroundColor";
			if(this.innerHTML == $("#software-hardware li")[1].innerHTML){
				$(".user-interface .ware1").removeClass("unshow");
				$(".user-interface .ware").addClass("unshow");
			}
			else{
				$(".user-interface .ware1").addClass("unshow");
				$(".user-interface .ware").removeClass("unshow");
			}
			if($("#software-hardware li")[1].className == "backgroundColor"){
				$("textarea").val("");
			}
		})
		$(".sign-in").click(function(){
			if($("textarea").val() == ""){
				var remarks = "未知故障";
			}
			else{
				remarks = $("textarea").val();				
			}
			$.ajax({
			url:`http://127.0.0.1:81/order`,
			data:{
				remarks:`${remarks}`
			},
			success:function(data){
				if(data == "预约成功"){
					window.location.href = "process.html";
				}
				else{
					alert("预约失败！！！")
				}
			},
		})
		})
		$("#button").click(function(){
			window.location.href = "process.html";
		})
	</script>
</body>
</html>